<template>
	<view hover-class="bg-lighting">
		<div class="flex align-stretch" @click="handleClick" @longpress="handleLongPress">
			<view class="flex align-center justify-center position-relative" style="width: 145rpx;">
				<!-- 列表头像 -->
				<free-avater :src="item.avatar" size="92" />
				<!-- 消息角标 -->
				<free-badge badgeClass="position-absolute" badgeStyle="top:15rpx;right:15rpx" v-if='item.noreadnum'
					:number="item.noreadnum" />
			</view>
			<view class="flex flex-column border-bottom flex-1 py-3 pr-3 border-light-secondary">
				<view class="flex align-center justify-between mb-1">
					<text class="font-md">{{item.nickname}}</text>
					<text class="font-sm text-light-muted">{{item.update_time|formatTime}}</text>
				</view>
				<text class="font text-ellipsis text-light-muted">{{item.data}}</text>
			</view>
		</div>
	</view>
</template>

<script>
	import freeAvater from "@/components/free-ui/free-avater.vue";
	import freeBadge from "@/components/free-ui/free-badge.vue";
	import freeBase from "@/common/mixin/free-base.js"
	export default {
		mixins:[freeBase],
		props: {
			item: Object,
			index: Number
		},
		components: {
			freeAvater,
			freeBadge
		},
		methods:{
			// 点击事件
			handleClick(){},
			// 长按事件
			handleLongPress(e){
				console.log('e==>',e);
			}
		}
	}
</script>

<style>
</style>